Skip to content

test(lsp): pin ripr/listActionableItems handler branches and exact capability contract - #3031

Merged
EffortlessSteven merged 1 commit into
mainfrom
codex/issue3012-handler-proof
Aug 8, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
codex/issue3012-handler-proof

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Context

PR #3012 merged in seconds without pre-merge review; substantive findings arrived post-merge and remained unresolved. This corrective candidate addresses every thread on the landed handler with code and evidence. Release disposition: post-0.11 development work (safe_defer_post_0_11, absent_by_candidate_only_exclusion) unless release authority promotes it.

Per-finding disposition

  1. gemini: "guard.clone() will not compile / type error" — REFUTED with evidence, style point taken. The merged code compiled because method resolution auto-derefs MutexGuard<Option<Arc<AnalysisSnapshot>>> to Option and calls Option::clone; the match already flattened, so no Option<Option<…>> ever existed. cargo check -p ripr on the merged base is clean. The "convoluted" critique had merit: the snapshot fetch now uses lock().ok().and_then(|guard| (*guard).clone()), behavior identical, with a comment recording the fail-closed semantics.
  2. tests-red-green: zero direct handler branch tests — FIXED. New list_actionable_items_tests harness (LspService + current-thread runtime, mirroring existing LSP handler tests) covers all four branches: no_snapshot, analysis_in_flight (no delivery selection), Unavailable delivery outcome, and the Applied happy path — the last built through the real DiagnosticDeliverySelection::evaluate, no fabricated budget result. Assertions cover error.kind/recovery_route, absence of snapshot identity on error paths, snapshot_id propagation, bounded counts, budget_identity, complete_evidence_identity, continuation_or_inspect_route, allowed_edit_surface == "read_only", and exact must_not_change.
  3. tests-oracle + gemini: weak capability inversion — FIXED. capability_advertises_only_implemented_handlers now asserts direct vector equality supported_requests == vec![ListActionableItems] and supported_profiles == vec![Actionable], and locks the rest of the v0_1_implemented contract: implementation_state, interim snapshot_handles, cancellation, fail-closed continuations/work_done_progress, push-only diagnostic_modes, exact claim_boundary, read-only source_edit_capability.
  4. Interim generation identity vs lifecycle(lsp): make standard diagnostics, result IDs, progress, cancellation, and refresh the currentness authority #1602 — BOUND explicitly. Comments at the handler's snapshot_id emission and at RiprAgentCapability::v0_1_implemented state the generation identity is an interim compatibility state, NOT lifecycle(lsp): make standard diagnostics, result IDs, progress, cancellation, and refresh the currentness authority #1602's immutable snapshot-handle contract, and must not be represented as such. Deliberately no wire-contract change (snapshot_handles: true is retained as the advertised interim state per the review's own "lock the current contract" instruction); re-scoping that flag is a lifecycle(lsp): make standard diagnostics, result IDs, progress, cancellation, and refresh the currentness authority #1602-slice decision.

Verification (independently re-run)

Follow-ups observed, not in scope

Refs #1603

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@EffortlessSteven, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e8e826ac-3961-4091-be78-807c44831da5

📥 Commits

Reviewing files that changed from the base of the PR and between 0e97192 and d566c05.

📒 Files selected for processing (2)
  • crates/ripr/src/lsp/agent_protocol.rs
  • crates/ripr/src/lsp/backend.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…pability contract

Address post-merge review findings on d3fafbc (#3012):

- Simplify the handler's snapshot extraction with and_then (gemini's
  'will not compile' claim is refuted: guard.clone() resolved through
  Deref to Option::clone, so main compiled; the match already flattened.
  The and_then form is still clearer and matches module style).
- Add direct unit tests for all four handler branches: no snapshot,
  analysis in flight (delivery_selection None), Unavailable outcome, and
  the Applied happy path, asserting JSON envelope fields including
  snapshot_id propagation and the read-only must_not_change invariants.
- Strengthen capability_advertises_only_implemented_handlers to direct
  vector equality on supported_requests/supported_profiles and lock the
  remaining v0_1_implemented fail-closed fields (snapshot_handles,
  cancellation, continuations, work_done_progress, diagnostic_modes,
  claim_boundary).
- Document that snapshot_id is the interim refresh-generation identity
  for this first slice, not #1602's immutable snapshot-handle contract,
  at both the emission site and the capability constructor.

Refs #1603
@EffortlessSteven
EffortlessSteven force-pushed the codex/issue3012-handler-proof branch from 0848a9b to d566c05 Compare August 8, 2026 01:07
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.44724% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ripr/src/lsp/agent_protocol.rs 45.94% 20 Missing ⚠️
crates/ripr/src/lsp/backend.rs 99.38% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@EffortlessSteven
EffortlessSteven merged commit 6fc4d5e into main Aug 8, 2026
23 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/issue3012-handler-proof branch August 8, 2026 01:24
EffortlessSteven added a commit that referenced this pull request Aug 11, 2026
…ipt (#3032) (#3133)

PR #3031 (6fc4d5e) landed the #3032 functional hardening: direct tests for
all four ripr_list_actionable_items branches, exact fail-closed capability
equality, and the interim snapshot_id boundary docs. The issue's residual
acceptance row is a retained removal/mutation receipt proving those tests
discriminate.

This change retains that receipt (docs/handoffs/
2026-08-11-list-actionable-items-mutation-receipt.md), run over origin/main
c8e3e18:

- Mutation A (no-snapshot branch kind flipped): exactly
  list_actionable_items_without_snapshot_fails_closed FAILED, 3 others ok.
- Mutation B (must_not_change removed from the success envelope): exactly
  list_actionable_items_applied_returns_bounded_envelope FAILED, 3 others ok.
- Mutation C (supported_requests emptied in v0_1_implemented): exactly
  capability_advertises_only_implemented_handlers FAILED, 10 others ok.

Each mutation kept the crate compilable and was reverted before the next ran;
git status is clean after all reversions.

The receipt also records the refutation of the #3012 post-merge review's
MutexGuard::clone claim: the exact landed extraction shape compiles and runs
under the pinned rustc 1.95.0 with -D warnings (clone resolves through Deref
to Option::<Arc<_>>::clone; verified by Arc::ptr_eq), and d3fafbc is an
ancestor of a main that builds. Not a defect; #3031's and_then form is a
clarity improvement only.

Refs #3032

Co-authored-by: Test <test@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant